
<#include "header.ftl">
  <!-- 内容区域 -->
<div class="tpl-content-wrapper">
 <div class="container-fluid am-cf">
                <div class="row">
                     <div class="am-u-sm-12 am-u-md-12 am-u-lg-9">
                        <ol class="am-breadcrumb">
						  <li><a href="${Domain}my" class="am-icon-home">首页</a></li>
						  <li ><a href="${Domain}my/user/list/${r.id}">${r.name}</a></li>
						  <li class="am-active">编辑成员</li>
						</ol>
                    </div>
                  	<#include "../common/return.ftl">
                </div>
  </div>
       <div class="row-content am-cf">
                <div class="row">
  
                    <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
                        <div class="widget am-cf">
                            <div class="widget-head am-cf">
                                <div class="widget-title  am-cf">编辑成员</div>

                            </div>
                            <div class="widget-body  am-fr">
                            
                             <form class="am-form tpl-form-line-form"  method="post" action="${Domain}api/user/change" id="user-change" >
                                    
                                  <input type="hidden" id="id" name="id" value="${u.id}">
                                     <div class="am-form-group">
                                        <label for="user-phone" class="am-u-sm-3 am-u-md-3 am-form-label">角色</label>
                                        <div class="am-u-sm-8 am-u-md-6 am-form-group ">
                                          <select data-am-selected="{btnSize: 'sm'}" name="role" id="role">
                                          <#list list as item>
										  <option value="${item.id}"  <#if role==item.id>selected</#if>>${item.name}</option> 
							              </#list>
										 </select>

                                        </div>
                                        <label  class="am-u-sm-1 am-u-md-3"></label>
                                    </div>
                                    
                                     <div class="am-form-group">
                                        <label  class="am-u-sm-3 am-u-md-3 am-form-label">账户 </label>
                                        <div class="am-u-sm-8 am-u-md-6">
                                            <input type="text" class="tpl-form-input" id="account" name="account" value="${u.account}"  readonly="readonly"/>                                   
                                        </div>
                                        <label  class="am-u-sm-1 am-u-md-3"></label>
                                    </div>
                                    <div class="am-form-group">
                                        <label  class="am-u-sm-3 am-u-md-3 am-form-label">姓名 </label>
                                        <div class="am-u-sm-8 am-u-md-6">
                                            <input type="text" class="tpl-form-input" id="name" name="name" value="${u.name}" placeholder="请输入真实姓名"  required/>
                                        </div>
                                        <label  class="am-u-sm-1 am-u-md-3"></label>
                                    </div>
									 
                                    <div class="am-form-group">
                                        <label  class="am-u-sm-3 am-u-md-3 am-form-label">电话 </label>
                                        <div class="am-u-sm-8 am-u-md-6">
                                            <input type="text" class="tpl-form-input" id="phone" name="phone"  value="${u.phone}" placeholder="请输入联系电话" >
                                        </div>
                                        <label  class="am-u-sm-1 am-u-md-3"></label>
                                    </div>
									<div class="am-form-group">
                                        <label  class="am-u-sm-3 am-u-md-3 am-form-label">邮件 </label>
                                        <div class="am-u-sm-8 am-u-md-6">
                                            <input type="email" class="tpl-form-input" id="email" name="email" value="${u.email}" placeholder="请输入邮箱" >
                                        </div>
                                        <label  class="am-u-sm-1 am-u-md-3"></label>
                                    </div>
                                    
                                	<div class="am-form-group">
                                        <label  class="am-u-sm-3 am-u-md-3 am-form-label">职位 </label>
                                        <div class="am-u-sm-8 am-u-md-6">
                                            <input type="text" class="tpl-form-input" id="position" name="position" value="${u.position}" placeholder="请输入职位" >
                                        </div>
                                        <label  class="am-u-sm-1 am-u-md-3"></label>
                                    </div>
                                    <div class="am-form-group">
                                        <div class="am-u-sm-6 am-u-sm-push-3">
                                            <button type="submit" id="sub" class="am-btn page-header-button tpl-btn-bg-color-success am-btn-block">确定修改</button>
                                        </div>
                                    </div>
                                </form>
                            
                            </div>
                        </div>
                    </div>
                </div>
            </div> 
 </div>   

  <script type="text/javascript">
   var loading ; 
   $('#user-change').ajaxForm({
	    beforeSubmit: function(a,f,o) {
	        loading = weui.loading('数据加载中...');
	    },
	    success: function(json) {	    	
	    	if(json.status)
	    	{
	    	  	if(loading) loading.hide();
	    		weui.toast(json.msg); 
	    		<#if ask.url??>
	    		location.href="${ask.url}";	
	    		</#if>		
	    				
	    	}else
	    	{	
	    		if(loading) loading.hide();
	    	    weui.alert(json.msg);  		 
	    	}
	    }
	});
	</script>          
<#include "footer.ftl">